package com.oot.twitter.info;

import org.json.JSONObject;

/**
 * Created by IntelliJ IDEA.
 * User: luckymancvp
 * Date: 8/31/12
 * Time: 11:25 AM
 */
public class TJSonParser  {
	private JSONObject jsonObject;

	public TJSonParser(JSONObject jsonObject) {
		this.jsonObject = jsonObject;
	}

	public String getString(String name,String defaultString) {
		String returnString;
		try{
			returnString = jsonObject.getString(name);
			if (returnString == null)
				return defaultString;
			return returnString;
		}catch (Exception e){
			return defaultString;
		}
	}
}
